package com.authority.framework.web.service.impl;

import com.authority.framework.base.service.impl.BaseServiceImpl;
import com.authority.framework.web.domain.SysUserEntity;
import com.authority.framework.web.service.PrivLoginService;
import org.beetl.sql.core.SQLManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: authority
 * @description: 用户登陆 impl层
 * @author: Mr.Yan
 * @create: 2018-11-15 13:47
 **/
@Service
@Transactional
public class PrivLoginServiceImpl extends BaseServiceImpl<SysUserEntity> implements PrivLoginService {
	@Autowired
	private SQLManager sqlManager;

	//  参数
	private Map<String,String> paramMap = null;

	/**
	 * 登陆验证
	 * @param username
	 * @param password
	 * @return
	 */
	@Override
	public SysUserEntity login(String username, String password) {
		paramMap = new HashMap<>();
		paramMap.put("userName",username);
		paramMap.put("passWord",password);
		return sqlManager.selectUnique("system/PrivLoginSql.login",paramMap,SysUserEntity.class);
	}
}
